import WebStorageCache from 'web-storage-cache'

type CacheType = 'localStorage' | 'sessionStorage' | Storage | undefined

export const useCache = (storage?: CacheType) => {
  const wsCache: WebStorageCache = new WebStorageCache({
    storage
  })

  return {
    wsCache
  }
}
